﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BusinessLogicLayer.SinhVien;
using BusinessLogicLayer;
using System.Security.Cryptography;

namespace QuanLyDoAn.SinhVien
{
    public partial class Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnLogin_Click(object sender, EventArgs e)
        {
            UserFuntion us = new UserFuntion();
           String pw = MaHoa.GetMD5(txtPassWord.Text);
            int t = UserFuntion.User_CheckLogin(txtUserName.Text.Trim(), txtPassWord.Text);
            if (t > 0)
            {
                Session["UserName"] = txtUserName.Text.Trim();
                Session["Role"] = t;
                Response.Redirect("~/SinhVien/Home.aspx");
            }
            else
            {
              //  rfvUserName.Text.ToString();
                txtPassWord.Text = " ";
                txtUserName.Text = " ";
                lbNotice.Text = "Sai tên đăng nhập hay mật khẩu";
            }

        }
    }
}